package com.zenchn.dynamic;

import static com.zenchn.dynamic.TSysWebStyleConfigDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.*;

import com.zenchn.model.TSysWebStyleConfig;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import javax.annotation.Generated;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.dynamic.sql.BasicColumn;
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider;
import org.mybatis.dynamic.sql.insert.render.MultiRowInsertStatementProvider;
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.update.UpdateDSL;
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
import org.mybatis.dynamic.sql.update.UpdateModel;
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;

@Mapper
public interface TSysWebStyleConfigDynamicMapper {
    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    BasicColumn[] selectList = BasicColumn.columnList(styleConfigId, isGeneric, projectId, platformName, accessParameter, iconFileId, logoFileId, copyright, platformStyle, overviewDiagramStyle, offlineImageStatus, carouselImageIds, memo);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    long count(SelectStatementProvider selectStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
    int delete(DeleteStatementProvider deleteStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @InsertProvider(type=SqlProviderAdapter.class, method="insert")
    int insert(InsertStatementProvider<TSysWebStyleConfig> insertStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @InsertProvider(type=SqlProviderAdapter.class, method="insertMultiple")
    int insertMultiple(MultiRowInsertStatementProvider<TSysWebStyleConfig> multipleInsertStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    @ResultMap("TSysWebStyleConfigResult")
    Optional<TSysWebStyleConfig> selectOne(SelectStatementProvider selectStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    @Results(id="TSysWebStyleConfigResult", value = {
        @Result(column="style_config_id", property="styleConfigId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="is_generic", property="isGeneric", jdbcType=JdbcType.BIT),
        @Result(column="project_id", property="projectId", jdbcType=JdbcType.CHAR),
        @Result(column="platform_name", property="platformName", jdbcType=JdbcType.VARCHAR),
        @Result(column="access_parameter", property="accessParameter", jdbcType=JdbcType.VARCHAR),
        @Result(column="icon_file_id", property="iconFileId", jdbcType=JdbcType.CHAR),
        @Result(column="logo_file_id", property="logoFileId", jdbcType=JdbcType.CHAR),
        @Result(column="copyright", property="copyright", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_style", property="platformStyle", jdbcType=JdbcType.VARCHAR),
        @Result(column="overview_diagram_style", property="overviewDiagramStyle", jdbcType=JdbcType.VARCHAR),
        @Result(column="offline_image_status", property="offlineImageStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="carousel_image_ids", property="carouselImageIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="memo", property="memo", jdbcType=JdbcType.VARCHAR)
    })
    List<TSysWebStyleConfig> selectMany(SelectStatementProvider selectStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    @UpdateProvider(type=SqlProviderAdapter.class, method="update")
    int update(UpdateStatementProvider updateStatement);

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default long count(CountDSLCompleter completer) {
        return MyBatis3Utils.countFrom(this::count, TSysWebStyleConfig, completer);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int delete(DeleteDSLCompleter completer) {
        return MyBatis3Utils.deleteFrom(this::delete, TSysWebStyleConfig, completer);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int deleteByPrimaryKey(String styleConfigId_) {
        return delete(c -> 
            c.where(styleConfigId, isEqualTo(styleConfigId_))
        );
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int insert(TSysWebStyleConfig record) {
        return MyBatis3Utils.insert(this::insert, record, TSysWebStyleConfig, c ->
            c.map(styleConfigId).toProperty("styleConfigId")
            .map(isGeneric).toProperty("isGeneric")
            .map(projectId).toProperty("projectId")
            .map(platformName).toProperty("platformName")
            .map(accessParameter).toProperty("accessParameter")
            .map(iconFileId).toProperty("iconFileId")
            .map(logoFileId).toProperty("logoFileId")
            .map(copyright).toProperty("copyright")
            .map(platformStyle).toProperty("platformStyle")
            .map(overviewDiagramStyle).toProperty("overviewDiagramStyle")
            .map(offlineImageStatus).toProperty("offlineImageStatus")
            .map(carouselImageIds).toProperty("carouselImageIds")
            .map(memo).toProperty("memo")
        );
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int insertMultiple(Collection<TSysWebStyleConfig> records) {
        return MyBatis3Utils.insertMultiple(this::insertMultiple, records, TSysWebStyleConfig, c ->
            c.map(styleConfigId).toProperty("styleConfigId")
            .map(isGeneric).toProperty("isGeneric")
            .map(projectId).toProperty("projectId")
            .map(platformName).toProperty("platformName")
            .map(accessParameter).toProperty("accessParameter")
            .map(iconFileId).toProperty("iconFileId")
            .map(logoFileId).toProperty("logoFileId")
            .map(copyright).toProperty("copyright")
            .map(platformStyle).toProperty("platformStyle")
            .map(overviewDiagramStyle).toProperty("overviewDiagramStyle")
            .map(offlineImageStatus).toProperty("offlineImageStatus")
            .map(carouselImageIds).toProperty("carouselImageIds")
            .map(memo).toProperty("memo")
        );
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int insertSelective(TSysWebStyleConfig record) {
        return MyBatis3Utils.insert(this::insert, record, TSysWebStyleConfig, c ->
            c.map(styleConfigId).toPropertyWhenPresent("styleConfigId", record::getStyleConfigId)
            .map(isGeneric).toPropertyWhenPresent("isGeneric", record::getIsGeneric)
            .map(projectId).toPropertyWhenPresent("projectId", record::getProjectId)
            .map(platformName).toPropertyWhenPresent("platformName", record::getPlatformName)
            .map(accessParameter).toPropertyWhenPresent("accessParameter", record::getAccessParameter)
            .map(iconFileId).toPropertyWhenPresent("iconFileId", record::getIconFileId)
            .map(logoFileId).toPropertyWhenPresent("logoFileId", record::getLogoFileId)
            .map(copyright).toPropertyWhenPresent("copyright", record::getCopyright)
            .map(platformStyle).toPropertyWhenPresent("platformStyle", record::getPlatformStyle)
            .map(overviewDiagramStyle).toPropertyWhenPresent("overviewDiagramStyle", record::getOverviewDiagramStyle)
            .map(offlineImageStatus).toPropertyWhenPresent("offlineImageStatus", record::getOfflineImageStatus)
            .map(carouselImageIds).toPropertyWhenPresent("carouselImageIds", record::getCarouselImageIds)
            .map(memo).toPropertyWhenPresent("memo", record::getMemo)
        );
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default Optional<TSysWebStyleConfig> selectOne(SelectDSLCompleter completer) {
        return MyBatis3Utils.selectOne(this::selectOne, selectList, TSysWebStyleConfig, completer);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default List<TSysWebStyleConfig> select(SelectDSLCompleter completer) {
        return MyBatis3Utils.selectList(this::selectMany, selectList, TSysWebStyleConfig, completer);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default List<TSysWebStyleConfig> selectDistinct(SelectDSLCompleter completer) {
        return MyBatis3Utils.selectDistinct(this::selectMany, selectList, TSysWebStyleConfig, completer);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default Optional<TSysWebStyleConfig> selectByPrimaryKey(String styleConfigId_) {
        return selectOne(c ->
            c.where(styleConfigId, isEqualTo(styleConfigId_))
        );
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int update(UpdateDSLCompleter completer) {
        return MyBatis3Utils.update(this::update, TSysWebStyleConfig, completer);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    static UpdateDSL<UpdateModel> updateAllColumns(TSysWebStyleConfig record, UpdateDSL<UpdateModel> dsl) {
        return dsl.set(styleConfigId).equalTo(record::getStyleConfigId)
                .set(isGeneric).equalTo(record::getIsGeneric)
                .set(projectId).equalTo(record::getProjectId)
                .set(platformName).equalTo(record::getPlatformName)
                .set(accessParameter).equalTo(record::getAccessParameter)
                .set(iconFileId).equalTo(record::getIconFileId)
                .set(logoFileId).equalTo(record::getLogoFileId)
                .set(copyright).equalTo(record::getCopyright)
                .set(platformStyle).equalTo(record::getPlatformStyle)
                .set(overviewDiagramStyle).equalTo(record::getOverviewDiagramStyle)
                .set(offlineImageStatus).equalTo(record::getOfflineImageStatus)
                .set(carouselImageIds).equalTo(record::getCarouselImageIds)
                .set(memo).equalTo(record::getMemo);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    static UpdateDSL<UpdateModel> updateSelectiveColumns(TSysWebStyleConfig record, UpdateDSL<UpdateModel> dsl) {
        return dsl.set(styleConfigId).equalToWhenPresent(record::getStyleConfigId)
                .set(isGeneric).equalToWhenPresent(record::getIsGeneric)
                .set(projectId).equalToWhenPresent(record::getProjectId)
                .set(platformName).equalToWhenPresent(record::getPlatformName)
                .set(accessParameter).equalToWhenPresent(record::getAccessParameter)
                .set(iconFileId).equalToWhenPresent(record::getIconFileId)
                .set(logoFileId).equalToWhenPresent(record::getLogoFileId)
                .set(copyright).equalToWhenPresent(record::getCopyright)
                .set(platformStyle).equalToWhenPresent(record::getPlatformStyle)
                .set(overviewDiagramStyle).equalToWhenPresent(record::getOverviewDiagramStyle)
                .set(offlineImageStatus).equalToWhenPresent(record::getOfflineImageStatus)
                .set(carouselImageIds).equalToWhenPresent(record::getCarouselImageIds)
                .set(memo).equalToWhenPresent(record::getMemo);
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int updateByPrimaryKey(TSysWebStyleConfig record) {
        return update(c ->
            c.set(isGeneric).equalTo(record::getIsGeneric)
            .set(projectId).equalTo(record::getProjectId)
            .set(platformName).equalTo(record::getPlatformName)
            .set(accessParameter).equalTo(record::getAccessParameter)
            .set(iconFileId).equalTo(record::getIconFileId)
            .set(logoFileId).equalTo(record::getLogoFileId)
            .set(copyright).equalTo(record::getCopyright)
            .set(platformStyle).equalTo(record::getPlatformStyle)
            .set(overviewDiagramStyle).equalTo(record::getOverviewDiagramStyle)
            .set(offlineImageStatus).equalTo(record::getOfflineImageStatus)
            .set(carouselImageIds).equalTo(record::getCarouselImageIds)
            .set(memo).equalTo(record::getMemo)
            .where(styleConfigId, isEqualTo(record::getStyleConfigId))
        );
    }

    @Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: t_sys_web_style_config")
    default int updateByPrimaryKeySelective(TSysWebStyleConfig record) {
        return update(c ->
            c.set(isGeneric).equalToWhenPresent(record::getIsGeneric)
            .set(projectId).equalToWhenPresent(record::getProjectId)
            .set(platformName).equalToWhenPresent(record::getPlatformName)
            .set(accessParameter).equalToWhenPresent(record::getAccessParameter)
            .set(iconFileId).equalToWhenPresent(record::getIconFileId)
            .set(logoFileId).equalToWhenPresent(record::getLogoFileId)
            .set(copyright).equalToWhenPresent(record::getCopyright)
            .set(platformStyle).equalToWhenPresent(record::getPlatformStyle)
            .set(overviewDiagramStyle).equalToWhenPresent(record::getOverviewDiagramStyle)
            .set(offlineImageStatus).equalToWhenPresent(record::getOfflineImageStatus)
            .set(carouselImageIds).equalToWhenPresent(record::getCarouselImageIds)
            .set(memo).equalToWhenPresent(record::getMemo)
            .where(styleConfigId, isEqualTo(record::getStyleConfigId))
        );
    }
}